Lemma (Jordan). Suppose f is analytic on the closed upper half plane excluding some disc, \left\{z : \operatorname*{Im}z\ge 0\right\}\cap \left\{z : |z| \ge R_0\right\}, which satisfies |f(z)| \le M/R^\beta for some M, \beta > 0 on the outside region \Gamma_R = \left\{Re^{i\theta} : R > R_0, 0 \le \theta \le \pi\right\}. Then, for all \alpha > 0, \lim_{R \to \infty}\int_{\Gamma_R}e^{i\alpha z}f(z)\,dz = 0. Proof. On \Gamma_R, we have z=Re^{i\theta} and dz=iRe^{i\theta}. Substituting in, \begin{aligned} \left|\,\int_{\Gamma_R}e^{i\alpha z}f(z)\,dz\, \right|= R\left|\, \int_0^\pi e^{i\alpha R e^{i\theta}}f(Re^{i\theta})\,d\theta\, \right| &\le R\int_0^\pi \left| e^{i\alpha Re^{i\theta}}f(Re^{i\theta})\right|\,d\theta. \end{aligned} Expanding e^{i\theta} in the inner exponent and taking the modulus gives us \begin{aligned} =R\int_0^\pi \left| e^{i\alpha (R\cos \theta + iR\sin \theta)}f(Re^{i\theta}) \right|\,d\theta = R\int_0^\pi e^{-\alpha R \sin \theta} \left|f(Re^{i\theta}) \right|\,d\theta. \end{aligned} Now we use the bound assumption on f and symmetry of the integrand, \le \frac M{R^{\beta-1}} \int_0^\pi e^{-\alpha R \sin \theta}\,d\theta = \frac {2M}{R^{\beta-1}}\int_0^{\pi/2}e^{-\alpha R\sin \theta}\,d\theta. Note that \sin \theta \ge 2\theta / \pi for 0 \le \theta \le \pi/2 (can be proven via simple calculus). Using this, we have \begin{aligned} \frac {2M}{R^{\beta-1}}\int_0^{\pi/2}e^{-\alpha R\sin \theta}\,d\theta &\le \frac {2M}{R^{\beta-1}}\int_0^{\pi/2}e^{-2\alpha R\theta/\pi}\,d\theta = \frac {2M}{R^{\beta-1}}\frac {\pi}{2\alpha R}\left( 1 - e^{-\alpha R} \right) = \frac {M\pi}{\alpha R^\beta}\left(1-e^{\alpha R}\right) \end{aligned} which we can see goes to 0 as R \to \infty. \square
To solve integrals of the form \int_0^{2\pi }f(\sin t, \cos t)\,dt we can try the substitutions z=\cos t + i \sin t, \quad z^{-1}=\cos t-i \sin t with the motivation being z=e^{it} for 0 \le t \le 2\pi. Then we just need to integrate around the unit circle. This gives us \begin{gathered} \cos t = \frac 1 2 \left(z+z^{-1}\right)\quad \text{and}\quad \sin t=\frac 1 {2i}\left( z - z^{-1} \right) \end{gathered} which implies that dz=(-\sin t + i \cos t)\,dt=iz\,dt. Example: Find I = \int_0^{2\pi}1/(2+\cos t)\,dt. Write z=e^{it} and using the substitution above, dt=\frac {dt}{iz} \quad \text{and}\quad\cos t = \frac 1 2 \left( z+z^{-1} \right). For C = \left\{ e^{it}, 0 \le t \le 2\pi \right\}, we have \begin{aligned} I = \int_C \frac {1/(iz)}{2+1/2\left( z+z^{-1} \right)}\,dz = -i\int_C \frac {dz}{2z+1/2\left( z^2+1 \right)} =-2i\int_C\frac {dz}{z^2+4z+1}. \end{aligned} To evaluate the last integral, note that the integrand is analytic except for zeros of the denominator, -2\pm \sqrt 3. Only -2+\sqrt 3 lies inside C, so by residue theorem I = (-2i)2\pi i \operatorname*{Res}_{z=-2+\sqrt 3}\frac {1}{z^2+4z+1}=\operatorname*{Res}_{z=-2+\sqrt 3}\frac {1/(z-(-2-\sqrt 3))}{z-(-2+\sqrt 3)}. The numerator is analytic and non-zero near -2+\sqrt 3 so the integrand has a simple pole at -2+\sqrt 3. The residue is calculated by \operatorname*{Res}_{z=-2+\sqrt 3}\frac {1}{z^2 + 4z+1}=\phi(-2+\sqrt 3)=\frac {1}{2\sqrt 3} and hence, I = (-2i)2\pi i /(2\sqrt 3)=2\pi / \sqrt 3.
We will try to calculate the Laurent series of 1/\sinh z at 0. This has singularities where \sinh z=0 which is exactly for z=n\pi i, n \in \mathbb Z. Thus, 1/\sinh z has a Laurent series on 0<|z|<\pi. Then, writing out the series, \begin{aligned} \frac {1}{\sinh z} &= \frac {1}{z + z^3/3! + z^5/5! + \cdots} = \frac 1 z \frac {1}{1+z^2/3! + z^4/5! + \cdots}. \end{aligned} For |z^2/3! + z^4/5! + \cdots|<1, we can use the geometric series formula as long as |z| is sufficiently small. \frac 1 {\sinh z} = \frac 1 z \left[ 1 - \left(\frac{z^2}{3!} + \frac{z^4}{5!} + \cdots\right) + \left(\frac{z^2}{3!} + \frac{z^4}{5!} + \cdots\right)^2 - \cdots \right] In particular, there is a pole of order 1 at 0 with \operatorname*{Res}_{z=0}\frac {1}{\sinh z}=1.
We start with \cot z = \cos z / \sin z and the usual Taylor series of \sin and \cos. \begin{aligned} g(z) = \frac {\cot z}{z^2} = \frac 1 {z^2}\frac {\cos z}{\sin z} &=\frac {1} {z^2}\left( \frac {\sum_{n=0}^\infty (-1)^nz^{2n}/(2n)!}{\sum_{n=0}^\infty (-1)^nz^{2n+1}/(2n+1)!} \right) \\ &=\frac {1}{z^2}\frac {\left(1-z^2/2! + z^4/4! - \cdots\right)} {\left(z-z^3/3!+z^5/5!+\cdots\right)} \\ &= \frac {1}{z^3} \frac {\left(1-z^2/2! + z^4/4! - \cdots\right)} {\left(1-z^2/3!+z^4/5!+\cdots\right)} \\ \end{aligned} Above, we expanded the power series of \sin and \cos, then factored a z out of the denominator with the goal of using the geometric series formula. Continuing, \begin{aligned} \frac {1}{z^3} \frac {\left(1-z^2/2! + z^4/4! - \cdots\right)} {\left(1-z^2/3!/+z^4/5!+\cdots\right)} &= \frac {1}{z^3} \frac {\left(1-z^2/2! + z^4/4! - \cdots\right)} {1-(z^2/3!+z^4/5!+\cdots)}. \end{aligned} The tail of the denominator series converges (why?) and has modulus less than 1 (really?) and so we can write this as a geometric series. Expanding a few terms is sufficient to determine the residue. \begin{aligned} g(z)&=\frac {1}{z^3} \left(1-z^2/2! + z^4/4! - \cdots\right) \sum_{n=0}^\infty (z^2/3!+z^4/5!+\cdots)^n \\ &= \frac {1}{z^3} \Big(1-z^2/2! + z^4/4! - \cdots\Big) \Big(1 + (z^2/3!+\cdots) + (z^2/3!+\cdots)^2+\cdots\Big)\\ &= \frac {1}{z^3}\left(1 + \left( \frac {1}{3!}-\frac {1}{2!} \right)z^2 + \cdots\right) \end{aligned} Looking at the fractions, 1/6-1/2=-1/3 so the residue at 0 is -1/3. Anything more than this is going to be very hard.